{% extends 'it/base.html' %}
{% block title_action %}{{ title }}{% endblock title_action %}

{% block css_other %}
{% endblock css_other %}

{% block content %}
    <div class="container">
      <!-- Main component for a primary marketing message or call to action -->
      <div class="jumbotron">
          <h3>{{ title }}</h3>
          <div id="message" class="ui-corner-all">
            {% if links %}
                <ul>
                    {% for link,name in links %}
                        <li><a href="{{ link }}">{{ name }}</a></li>
                    {% endfor %}
                </ul>
            {% endif %}
          </div>
          {% if callback %}
            <p>
                系统将在<span id="second">10</span>秒后执行指令: <a href="{{ callback.0 }}">{{ callback.1 }}</a>
            </p>
          {% endif %}
      </div>

    </div> <!-- /container -->
{% endblock content %}

{% block js_bottom_other %}
    <script type="text/javascript">
        {% if callback %}
            var seconds = 10;
            setInterval(function() {
                $('#second').text(seconds--);
                if (seconds === 0) {
                    window.location.href = "{{ callback.0 }}";
                }
            }, 1000);
        {% endif %}
    </script>
{% endblock js_bottom_other %}